﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CoreGallery.Core.AddinMgr;
using System.Windows.Markup;
using CoreGallery.Addins.Contracts;

namespace CoreGallery.Core.UI
{
    public partial class AddinManagerWindow : Window
    {
        private AddinManager _mgr;

        public AddinManagerWindow()
        {
            InitializeComponent();
        }

        public void SetItemSource(AddinManager mgr)
        {
            _mgr = mgr;
            AddinsListBox.ItemsSource = _mgr.GetLoadedAddins<IAcquisitionAddinBase>();
        }

        private void ImportersButton_Click(object sender, RoutedEventArgs e)
        {
            AddinsListBox.ItemsSource = _mgr.GetLoadedAddins<IAcquisitionAddinBase>();
        }

        private void ExportersButton_Click(object sender, RoutedEventArgs e)
        {
            AddinsListBox.ItemsSource = _mgr.GetLoadedAddins<IPublishingAddinBase>();
        }

        private void TransformersButton_Click(object sender, RoutedEventArgs e)
        {
            AddinsListBox.ItemsSource = _mgr.GetLoadedAddins<ITransformAddinBase>();
        }

        private void ServicesButton_Click(object sender, RoutedEventArgs e)
        {
            AddinsListBox.ItemsSource = _mgr.GetLoadedAddins<IServiceAddinBase>();
        }

        private void StorageButton_Click(object sender, RoutedEventArgs e)
        {
            AddinsListBox.ItemsSource = _mgr.GetLoadedAddins<IStorageProviderBase>();

        }

        private void ButtonFindUpdates_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}